#include <sdk.h>
#include "buildtargetpanel.h"

const long BuildTargetPanel::ID_STATICTEXT1 = wxNewId();
const long BuildTargetPanel::ID_STATICTEXT3 = wxNewId();
const long BuildTargetPanel::ID_TEXTCTRL1 = wxNewId();
const long BuildTargetPanel::ID_STATICTEXT2 = wxNewId();
const long BuildTargetPanel::ID_COMBOBOX1 = wxNewId();
const long BuildTargetPanel::ID_STATICTEXT4 = wxNewId();
const long BuildTargetPanel::ID_TEXTCTRL2 = wxNewId();
const long BuildTargetPanel::ID_STATICTEXT5 = wxNewId();
const long BuildTargetPanel::ID_TEXTCTRL3 = wxNewId();
const long BuildTargetPanel::ID_CHECKBOX1 = wxNewId();

BEGIN_EVENT_TABLE( BuildTargetPanel, wxPanel )
END_EVENT_TABLE()

BuildTargetPanel::BuildTargetPanel( wxWindow* parent, wxWindowID id ) {
  wxFlexGridSizer* FlexGridSizer1;
  wxStaticText* StaticText1;
  wxStaticText* StaticText4;
  wxStaticText* StaticText5;
  wxStaticBoxSizer* StaticBoxSizer1;
  Create( parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T( "id" ) );
  BoxSizer1 = new wxBoxSizer( wxVERTICAL );
  StaticText1 = new wxStaticText( this, ID_STATICTEXT1, _T( "请为新生成目标设置选项." ), wxDefaultPosition, wxDefaultSize, 0, _T( "ID_STATICTEXT1" ) );
  BoxSizer1->Add( StaticText1, 0, wxALL | wxALIGN_LEFT, 8 );
  StaticText3 = new wxStaticText( this, ID_STATICTEXT3, _T( "生成目标名称:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "ID_STATICTEXT3" ) );
  BoxSizer1->Add( StaticText3, 0, wxTOP | wxLEFT | wxRIGHT | wxALIGN_LEFT, 8 );
  txtName = new wxTextCtrl( this, ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_TEXTCTRL1" ) );
  BoxSizer1->Add( txtName, 0, wxBOTTOM | wxLEFT | wxRIGHT | wxEXPAND, 8 );
  lblCompiler = new wxStaticText( this, ID_STATICTEXT2, _T( "编译程序:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "ID_STATICTEXT2" ) );
  BoxSizer1->Add( lblCompiler, 0, wxTOP | wxLEFT | wxRIGHT | wxALIGN_LEFT, 8 );
  cmbCompiler = new wxComboBox( this, ID_COMBOBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_SIMPLE | wxCB_READONLY, wxDefaultValidator, _T( "ID_COMBOBOX1" ) );
  BoxSizer1->Add( cmbCompiler, 0, wxBOTTOM | wxLEFT | wxRIGHT | wxEXPAND, 8 );
  StaticBoxSizer1 = new wxStaticBoxSizer( wxVERTICAL, this, _T( "选项" ) );
  FlexGridSizer1 = new wxFlexGridSizer( 0, 2, 5, 5 );
  FlexGridSizer1->AddGrowableCol( 1 );
  StaticText4 = new wxStaticText( this, ID_STATICTEXT4, _T( "输出目录.:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "ID_STATICTEXT4" ) );
  FlexGridSizer1->Add( StaticText4, 0, wxEXPAND, 5 );
  txtOut = new wxTextCtrl( this, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_TEXTCTRL2" ) );
  FlexGridSizer1->Add( txtOut, 0, wxEXPAND, 5 );
  StaticText5 = new wxStaticText( this, ID_STATICTEXT5, _T( "对象输出目录.:" ), wxDefaultPosition, wxDefaultSize, 0, _T( "ID_STATICTEXT5" ) );
  FlexGridSizer1->Add( StaticText5, 0, wxEXPAND, 5 );
  txtObjOut = new wxTextCtrl( this, ID_TEXTCTRL3, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_TEXTCTRL3" ) );
  FlexGridSizer1->Add( txtObjOut, 0, wxEXPAND, 5 );
  StaticBoxSizer1->Add( FlexGridSizer1, 1, wxALL | wxEXPAND, 8 );
  chkEnableDebug = new wxCheckBox( this, ID_CHECKBOX1, _T( "为此目标启用调试符号" ), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T( "ID_CHECKBOX1" ) );
  chkEnableDebug->SetValue( false );
  StaticBoxSizer1->Add( chkEnableDebug, 0, wxALL | wxALIGN_LEFT, 8 );
  BoxSizer1->Add( StaticBoxSizer1, 0, wxALL | wxEXPAND, 8 );
  SetSizer( BoxSizer1 );
  BoxSizer1->Fit( this );
  BoxSizer1->SetSizeHints( this );
  Connect( ID_TEXTCTRL1, wxEVT_COMMAND_TEXT_UPDATED, ( wxObjectEventFunction )&BuildTargetPanel::OntxtNameText );
}

BuildTargetPanel::~BuildTargetPanel() {
}


void BuildTargetPanel::OntxtNameText( M_Code_unused wxCommandEvent& event ) {
  txtOut->SetValue( _T( "bin" ) + wxString( wxFILE_SEP_PATH ) + txtName->GetValue() );
  txtObjOut->SetValue( _T( "obj" ) + wxString( wxFILE_SEP_PATH ) + txtName->GetValue() );
}
